﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Login : System.Web.UI.Page
{
    private string username;
    private string pwd;
    private string query;
    private System.Data.SqlClient.SqlDataReader rd;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        username = txtUserName.Text;
        pwd = txtPassword.Text;
        query = "Select UserName,Password from UserDetails";
        rd = ConnectionManager.ExecuteReader(query);
        while (rd.Read())
        {
            if (rd["UserName"] == username && rd["Password"] == pwd)
            {
                Response.Redirect("HomePage_User.aspx?userName=" + txtUserName.Text);
            }
        }
    }
    protected void lbtn_forgotpass_Click(object sender, EventArgs e)
    {

    }
}